from pydantic import ConfigDict, BaseModel

from core.data_types import DatetimeStr

class AccountApiKey(BaseModel):
    user_id: int
    api_key: str
    name: str | None = None
    is_active: bool | None = True
    total_use: int | None = 0

class ApiKeyOut(AccountApiKey):
    model_config = ConfigDict(from_attributes=True)

    id: int
    update_datetime: DatetimeStr
    create_datetime: DatetimeStr

class ApiKeyDel(BaseModel):
    api_key_name: str
    user_id: int


